#!/bin/bash
set -e

# 配置变量
WORKSPACE=/workspace

qemu-system-aarch64 \
  -M virt \
  -cpu cortex-a53 \
  -m 512 \
  -kernel /workspace/qemu/vmlinuz \
  -initrd /workspace/qemu/initrd.img \
  -drive file=/workspace/qemu/rootfs.img,format=raw,if=virtio,snapshot=on \
  -netdev user,id=net0,hostfwd=tcp::2345-:2345 \
  -device virtio-net-device,netdev=net0 \
  -nographic \
  -serial mon:stdio \
  -append 'root=/dev/vda rw console=ttyAMA0' #\
#  -S \
#  -gdb tcp::1234